package com.example.business_oa.service;

import com.example.comment_oa.dubbo.BusiDubbo;
import com.example.comment_oa.pojos.attendance.BusinessTripAp;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@Service
public class BusiService {
    @DubboReference(version = "1.0.0")
    BusiDubbo busiDubbo;

    //出差
    @GlobalTransactional(timeoutMills = 300000)
    public List<BusinessTripAp> busiByIdEnd(int id,String endTime){
        return busiDubbo.busiByIdEnd(id,endTime);
    }
    //ap
    @GlobalTransactional(timeoutMills = 300000)
    public int apBusi(BusinessTripAp businessTripAp, MultipartFile file){return busiDubbo.apBusi(businessTripAp,file);}
    //同意出差
    @GlobalTransactional(timeoutMills = 300000)
    public int yesBusi(String busiId,String yesUser){
        return busiDubbo.yesBusi(busiId,yesUser);
    }
    //拒绝出差
    @GlobalTransactional(timeoutMills = 300000)
    public int noBusi(String busiId,String yesUser){return busiDubbo.noBusi(busiId,yesUser);}
}
